﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using static S.Authorization.Read.API.Application.Command.MenuCommand.MenuCountCommand;

namespace S.Authorization.Read.API.Controllers
{
    /// <summary>
    /// 控制器—常用功能
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class MenuCountController : ControllerBase
    {
        private IMediator mediator;

        public MenuCountController(IMediator _mediator)
        {
            this.mediator = _mediator;
        }
        /// <summary>
        /// 常用功能显示
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> GetMenuCount()
        {
            return Ok(await mediator.Send(new GetMenuCountCommand() { }));
        }
    }
}
